package org.jhh.domain.strategy.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.jhh.domain.strategy.service.rule.filter.factor.DefaultLogicFactory;
import org.jhh.types.common.Constants;

import java.util.ArrayList;
import java.util.List;

@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class StrategyAwardRuleModelVO {


        private String ruleModels;

        public String[] raffleCenterRuleModelList(){
            List<String> ruleModelList = new ArrayList<>();
            String[] ruleModelValues = ruleModels.split(Constants.SPLIT);
            for (String ruleModelValue : ruleModelValues) {
                if (DefaultLogicFactory.LogicModel.isCenter(ruleModelValue)) {
                    ruleModelList.add(ruleModelValue);
                }
            }
            return ruleModelList.toArray(new String[0]);
        }
}
